﻿using AntdUI;
using System;
using System.Collections.Generic;
using System.ComponentModel.Design.Serialization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NAutoForm.utils
{
    public class EmailUtils
    {

        private static Random random = new Random();
        // 常见邮箱后缀
        private static string[] EmailPostString = {
            "gmail.com", "yahoo.com", "msn.com", "hotmail.com", "aol.com", "ask.com",
            "live.com", "qq.com", "0355.net", "163.com", "163.net", "263.net", "3721.net", 
            "yeah.net", "googlemail.com", "mail.com", "hotmail.com", "msn.com", 
            "yahoo.com", "gmail.com", "aim.com", "aol.com", "mail.com", "walla.com", 
            "inbox.com", "126.com", "163.com", "sina.com", "21cn.com", "sohu.com", 
            "yahoo.com.cn", "tom.com", "qq.com", "etang.com", "eyou.com", "56.com", "x.cn", 
            "chinaren.com", "sogou.com", "citiz.com"
        };
        /// <summary>
        /// 生成Email邮箱
        /// </summary>
        /// <returns></returns>
        public static string GetEmail()
        {
            int length = random.Next(5, 10);
            int pos = random.Next(0, EmailPostString.Length - 1);
            string NewEmailString = UsernameUtils.GetUsername();
            return $"{NewEmailString}@{EmailPostString[pos]}";
        }
    }
}
